package 转换为大写并返回;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(3333);

        Socket accept = serverSocket.accept();

        BufferedReader br = new BufferedReader(new InputStreamReader(accept.getInputStream()));
        String data = br.readLine();
        String newData = data.toUpperCase();

        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(accept.getOutputStream()));
        bw.write(newData);
        bw.newLine();
        bw.flush();

        accept.close();
        serverSocket.close();

    }
}
